#include "ST_PASS.h"
#include "Game/Game.h"
#include "Game/dConfig.h"
namespace LTGame
{
	ST_PASS::ST_PASS(GST_FLAG flag)
		: GameState(flag)
	{
		img_pass = CCSprite::spriteWithFile("gui_pic/gamepass.png");
		img_pass->setPosition(ccp(S_WIDTH_HALF, S_HEIGHT_HALF));
		img_pass->retain();
	}
	ST_PASS::~ST_PASS()
	{
		CC_SAFE_DELETE(img_pass);
	}
	bool ST_PASS::logic(void)
	{
		img_pass->visit();
		return true;
	}
	void ST_PASS::paint(void)
	{
	}
	bool ST_PASS::ccTouchBegan(CCTouch *pTouch, CCEvent *pEvent)
	{
		return true;
	}
	void ST_PASS::ccTouchEnded(CCTouch *pTouch, CCEvent *pEvent)
	{
		CCPoint point = pTouch->locationInView( pTouch->view() );
		if (CCGame->m_uiData->isPointerInBlock(point.x, point.y, Form_SetMusic,B_Form_Block_4))
		{
			CCGame->SetState(GST_MainMenu);
		}
	}
}